package com.property.demo.repository;

import com.property.demo.model.Building;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface BuildingRepository extends JpaRepository<Building, Long>, JpaSpecificationExecutor<Building> {
    
    List<Building> findByCommunityId(Long communityId);
    
    List<Building> findByNameContainingAndCommunityId(String name, Long communityId);
    
    Boolean existsByNameAndCommunityId(String name, Long communityId);
} 